package com.guo.controller;

import com.guo.config.AjaxResult;
import com.guo.entity.service.ITypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Api(tags = "类型接口",description = "电影类型详细描述")
@RequestMapping("/type")
public class TypeController {

    @Autowired
    private ITypeService service;

    @PostMapping("/{id}")
    @ApiOperation(value = "查询类型等信息",notes = "")
    public AjaxResult getType(@RequestBody @PathVariable("id") Integer id){
        try {
            List<String> all = service.getType(id);
            return AjaxResult.me(all);
        } catch (Exception e) {
            return AjaxResult.me("查询失败");
        }
    }

}
